﻿<%@ Page Title="Edit Guardian Information" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="EditGuardian.aspx.cs" Inherits="MyLocalChurch.KidsChurch.EditGuardian" %>
<%@ Register Src="~/WebControls/DatePicker.ascx" TagName="DatePicker" TagPrefix="uc" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <dav:MetadataSource runat="server" ID="msGuardian" ObjectType="<%$ Code: typeof(MyLocalChurch.Models.KidsChurch.Guardian) %>" />
    <ajaxToolkit:ToolkitScriptManager ID="toolkitScriptManager" runat="server"></ajaxToolkit:ToolkitScriptManager>
    <h2>
        Edit Guardian Information
    </h2>
    <div class="wrapper">
        <div class="left">
            <table>
                <tr>
                    <td>First Name:</td>
                    <td>
                        <asp:TextBox ID="txtFirstName" runat="server"></asp:TextBox>
                        <dav:DataAnnotationsValidator ID="davFirstName" runat="server"
                            MetadataSourceID="msGuardian"
                            ControlToValidate="txtFirstName"
                            ObjectProperty="FirstName" />
                    </td>
                </tr>
                <tr>
                    <td>Middle Name:</td>
                    <td>
                        <asp:TextBox ID="txtMiddleName" runat="server"></asp:TextBox>
                        <dav:DataAnnotationsValidator ID="davMiddleName" runat="server"
                            MetadataSourceID="msGuardian"
                            ControlToValidate="txtMiddleName"
                            ObjectProperty="MiddleName" />
                    </td>
                </tr>
                <tr>
                    <td>Last Name:</td>
                    <td>
                        <asp:TextBox ID="txtLastName" runat="server"></asp:TextBox>
                        <dav:DataAnnotationsValidator ID="davLastName" runat="server"
                            MetadataSourceID="msGuardian"
                            ControlToValidate="txtLastName"
                            ObjectProperty="LastName" />
                    </td>
                </tr>
                <tr>
                    <td>Nick Name:</td>
                    <td>
                        <asp:TextBox ID="txtNickName" runat="server"></asp:TextBox>
                        <dav:DataAnnotationsValidator ID="davNickName" runat="server"
                            MetadataSourceID="msGuardian"
                            ControlToValidate="txtNickName"
                            ObjectProperty="NickName" />
                    </td>
                </tr>
                <tr>
                    <td>Gender:</td>
                    <td><asp:DropDownList ID="ddlGender" runat="server"></asp:DropDownList></td>
                </tr>
                <tr>
                    <td>Birth Date:</td>
                    <td>
                        <uc:DatePicker ID="dpBirthDate" runat="server" Required="True" />
                    </td>
                </tr>
                <tr>
                    <td>Mobile Number:</td>
                    <td>
                        <asp:TextBox ID="txtMobileNumber" runat="server"></asp:TextBox>
                        <dav:DataAnnotationsValidator ID="davMobileNumber" runat="server"
                            MetadataSourceID="msGuardian"
                            ControlToValidate="txtMobileNumber"
                            ObjectProperty="MobileNumber" />
                    </td>
                </tr>
                <tr>
                    <td>E-mail Address:</td>
                    <td>
                        <asp:TextBox ID="txtEmailAddress" runat="server"></asp:TextBox>
                        <dav:DataAnnotationsValidator ID="davEmailAddress" runat="server"
                            MetadataSourceID="msGuardian"
                            ControlToValidate="txtEmailAddress"
                            ObjectProperty="EmailAddress" />
                    </td>
                </tr>
            </table>
        </div>
        <div class="right">
            <table>
                <tr>
                    <td>
                        Profile Photo:
                        <br />
                        <asp:FileUpload runat="server" ID="fileUploadPhoto" ViewStateMode="Enabled" EnableViewState="True" />
                        <asp:Button runat="server" ID="btnPhotoPreview" Text="Preview" CausesValidation="False"
                            OnClick="btnPhotoPreview_Click"/>
                        <br />
                        <asp:Image runat="server" ID="imagePreview" CssClass="profilePhoto" />
                    </td>
                </tr>
                <tr>
                    <td>
                        Additional Information:
                        <br />
                        <asp:TextBox ID="txtAdditionalInformation" runat="server" CssClass="fieldInputMultiline" TextMode="MultiLine" Rows="5"></asp:TextBox>
                        <dav:DataAnnotationsValidator ID="davAdditionalInformation" runat="server"
                            MetadataSourceID="msGuardian"
                            ControlToValidate="txtAdditionalInformation"
                            ObjectProperty="AdditionalInformation" />
                    </td>
                </tr>
            </table>
        </div>
    </div>
    <p>
        <asp:Button ID="btnSave" runat="server" CssClass="submitButton" Text="Save" OnClick="btnSave_Click"/>
        <a href="#" onclick="window.history.back();">Back</a>
    </p>
</asp:Content>
